package com.ecole.mines.model;

import java.util.ArrayList;

import android.os.Parcel;
import android.os.Parcelable;

public class Promotion implements Parcelable{
	
	private int id;
	private String name;
	private ArrayList<Cours> cours;
	
	public Promotion()
	{
		
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public ArrayList<Cours> getCours() {
		return cours;
	}
	public void setCours(ArrayList<Cours> cours) {
		this.cours = cours;
	}
	
	@Override
	public int describeContents() {
		return 0;
	}
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeString(name);
		dest.writeList(this.cours);
	}
	
	public Promotion (Parcel parcel) {
        this.id = parcel.readInt();
        this.name = parcel.readString();
        this.cours=parcel.readArrayList(Cours.class.getClassLoader());
    }
	
	// Method to recreate a Question from a Parcel
    public static Creator<Promotion> CREATOR = new Creator<Promotion>() {

        @Override
        public Promotion createFromParcel(Parcel source) {
            return new Promotion(source);
        }

        @Override
        public Promotion[] newArray(int size) {
            return new Promotion[size];
        }

    };
}
